#include<bits/stdc++.h>
using namespace std;

const int INF=0x3f3f3f3f;

long long f(int pos,int n,int k,vector<int>& grid){
    long long res=0;
    int l=0,r=n;
    while(l<r){
        int mid=(l+r)/2;
        if(grid[mid]>pos){
            r=mid-1;
        }else if(grid[mid]<pos){
            l=mid+1;
        }else{
            l=mid;
            break;
        }
    }
    r=l+1;
    while(n>k){
        if(l>0&&abs(pos-grid[l])<abs(pos-grid[r])){
            res+=abs(pos-grid[l]);
            l--;
        }else{
            res+=abs(pos-grid[r]);
            r++;
        }
        n--;
    }
    return res;
}

int solve(){
    int n,k;
    cin>>n>>k;
    vector<int> grid(n+1);
    for(int i=1;i<=n;i++){
        cin>>grid[i];
    }
    sort(grid.begin(),grid.end());
    int res=1,mn=INF,mx=grid[n];
    for(int i=1;i<=mx;i++){
        long long t=f(i,n,k,grid);
        cout<<i<<':'<<t<<'\n';
        if(t<mn){
            res=1;
            mn=t;
        }
        else if(t==mn){
            res++;
        }
        else{
            break;
        }
    }
    return res;
}

int main(){
    int t;
    cin>>t;
    while(t--){
        cout<<solve()<<'\n';
    }
    return 0;
}